package com.fpj.sat.vehicle_administrator.main;

import javax.swing.UIManager;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.fpj.sat.vehicle_administrator.view.PrincipalFrame;

/**
 * Hello world!
 *
 */
public class InitApplication {
	
	public static ApplicationContext CONTEXT;
	
    public static void main( String[] args ){
    	try {
    		UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
    	}catch (Exception e) {
			e.printStackTrace();
		}
    	inicializaContexto();
        new PrincipalFrame();
    }

	private static void inicializaContexto() {
		String[] springContext = {"classpath:spring/applicationContext-common.xml",
									"classpath:spring/applicationContext-service.xml",
									"classpath:spring/applicationContext-datasource.xml",
									"classpath:spring/applicationContext-mail.xml"};
		
		CONTEXT = new ClassPathXmlApplicationContext(springContext);
	}
}
